//index.js
//获取应用实例
var app = getApp()
Page({
  data: {
  },
  onShow: function () {
     var that = this;
     //判断缓存中如果存在授权码，则绕过授权码验证页面
     var auth_code  = wx.getStorageSync('auth_code') || '';
     var line_state = wx.getStorageSync('line_state');              line_state = line_state == 0 ? 0 : 1;
     if(auth_code !='' && line_state !=0){
        setTimeout(function(){
            wx.redirectTo({url: '/pages/battle/battle'})
        },2000)
     }else{
        setTimeout(function(){
            wx.redirectTo({url: '/pages/index/index'})
        },2000)
     }
  },
})
